/*
 * @Author: wuhao930406 1148547900@qq.com
 * @Date: 2023-10-25 16:32:10
 * @LastEditors: wuhao930406 1148547900@qq.com
 * @LastEditTime: 2023-10-27 16:50:25
 * @FilePath: /eggauthmoblie/config/config.default.js
 * @Description:
 *
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
 */
/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = (exports = {});

  // wechat_config
  config.wechat_config = {
    token: 'tianyuantupo2', // zuolingling654321
    appid: 'wx289794cd442ff592', // APPID
    appsecret: 'a625a15f135795a77d0a006dab34d22f', // APPSECRET  67c521797f217cc86753ab439dad0c60
  };

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1698127065269_9071';

  // add your middleware config here
  config.middleware = [];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  // redis
  config.redis = {
    client: {
      port: 6379, // Redis port
      host: '127.0.0.1', // Redis host
      password: 'auth',
      db: 0,
    },
  };
  // security
  config.security = {
    csrf: {
      enable: false,
    },
    domainWhiteList: [ '*' ], // 允许访问域名的白名单,*表示都能访问
  };
  // cors
  config.cors = {
    origin: '*',
    allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS',
    credentials: true,
  };

  return {
    ...config,
    ...userConfig,
  };
};
